//
//  FamilyModel.m
//  FD
//
//  Created by Yasin on 2018/10/24.
//  Copyright © 2018 ZhiYuan Network. All rights reserved.
//

#import "FamilyModel.h"

@implementation FamilyModel

+ (NSDictionary *)mj_replacedKeyFromPropertyName {
    return @{@"memberid":@"id"};
}


- (void)setMemberBirthday:(NSNumber *)memberBirthday {
    _memberBirthday = memberBirthday;

//    _birthdayStr = [NSString NYRtimeStrFromTimeStamp:[NSString stringWithFormat:@"%@",memberBirthday]];
    
    
   NSString *timeStamp = [self fd_timeFromTimeStamp:memberBirthday];
    _birthdayStr = timeStamp;
}


- (NSString *)fd_timeFromTimeStamp:(NSNumber *)timeStamp {
    // timeStampString 是服务器返回的13位时间戳
    NSString *timeStampString  = [NSString stringWithFormat:@"%@",timeStamp];
    
    // iOS 生成的时间戳是10位
    NSTimeInterval interval    =[timeStampString doubleValue] / 1000.0;
    NSDate *date               = [NSDate dateWithTimeIntervalSince1970:interval];
    
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd"];
    NSString *dateString       = [formatter stringFromDate: date];
    NSLog(@"服务器返回的时间戳对应的时间是:%@",dateString);
    
    return dateString;
}

@end
